package com.example.blog_system_ssm.mapper;

import com.example.blog_system_ssm.entity.ArticleEntity;
import com.example.blog_system_ssm.entity.vo.ArticleEntityVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int add(ArticleEntity articleEntity);

    ArticleEntity getDetailByIdAndUid(@Param("id") Integer id, @Param("uid") Integer uid);

    int update(ArticleEntity articleEntity);

    ArticleEntityVO getDetail(@Param("id") Integer id);

    int addRCount(@Param("id") Integer id);

    List<ArticleEntity> getArtListByUid(@Param("uid")Integer uid);

    int delArt(@Param("id") Integer id,@Param("uid")Integer uid);

    List<ArticleEntity> getArtListByPage(@Param("pageSize")Integer pageSize,@Param("offset")Integer offset);

    Integer getPageCount();


    List<ArticleEntity> getMyArtListByPage(@Param("pageSize")Integer pageSize,@Param("offset")Integer offset,@Param("uid") Integer uid);

    Integer getPageCountByUser(@Param("uid") Integer uid);
}
